# Contributor: Dmitry Zakharchenko <dmitz@disroot.org>
# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=pipe-viewer
pkgver=0.2.2
pkgrel=0
pkgdesc="Lightweight YouTube client that does not require an YouTube API key"
url="https://github.com/trizen/pipe-viewer"
arch="noarch"
license="Artistic-2.0"
makedepends="perl-module-build"
depends="
	perl-data-dump
	perl-json
	perl-libwww
	perl-lwp-protocol-https
	perl-term-readline-gnu
	perl-unicode-linebreak
	"
checkdepends="perl-test-pod"
subpackages="$pkgname-doc $pkgname-gtk"
source="$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz"

build() {
	perl Build.PL --gtk3
}

check() {
	./Build test
}

package() {
	./Build install --destdir "$pkgdir" --installdirs vendor
}

gtk() {
	depends="$pkgname perl-gtk3 perl-file-sharedir"
	pkgdesc="$pkgdesc (GTK interface)"

	amove usr/bin/gtk-pipe-viewer
	amove "usr/share/perl5/vendor_perl/auto/share/dist/WWW-PipeViewer/gtk-*"
	amove usr/share/perl5/vendor_perl/auto/share/dist/WWW-PipeViewer/icons
}

sha512sums="
6d651273467ba25c1205c14b7b79378486d60f21be9382c1d2e933c409a57c2c0a8c2d0953b3a036ca9fa2e40b2bfd841ffb7970a735e41268b7a4b4b63e6352  pipe-viewer-0.2.2.tar.gz
"
